﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="DAValidationWeb._Default" %>

<%@ Register Assembly="Core" Namespace="Core.Validation" TagPrefix="cc1" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
    <style type="text/css">
        .error, .field-validation-error { color: red; }
        
        .input-validation-valid, .field-validation-valid, .validation-summary-valid { display: none; }
        .input-validation-error { background-color: #fee; border: 1px solid red; outline: none; }
        .input-validation-error:focus { outline: none; }
        input[type="text"].input-validation-error:focus, select.input-validation-error:focus { outline: none; }
        
        .validation-summary-errors { background: none repeat scroll 0 0 #F2F2F2; border: 1px solid #CCCCCC; color: red; font-size: 14px; padding: 10px; }
        .validation-summary-errors span { font-weight: 700; }
        .validation-summary-errors ul { list-style: disc inside; }
        .validation-summary-errors ul li { font-weight: normal; }
        .validation-summary-errors ul li label, .validation-summary-errors ul li span { display: inline !important; font-weight: normal; }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <cc1:DaValidationSummary ID="DaValidationSummary1" runat="server" HeaderText="Plase correct the folowing errors:" />
    <fieldset>
        <legend>My Form</legend>
        <div>
            <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
        </div>
        <div>
            <br />
            <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click"></asp:Button>
        </div>
    </fieldset>
    <cc1:ModelValidator ID="ModelValidator1" runat="server" ModelType="Domain.Node, Domain"
        ValidationSummaryID="DaValidationSummary1">
        <ModelProperties>
            <cc1:ModelProperty PropertyName="Name" ControlToValidate="txtName" />
        </ModelProperties>
    </cc1:ModelValidator>
</asp:Content>
